{if $no_result}
<h2>Sorry! We don't have results yet.</h2>
{else}
<h2>Ranking result from {$calc_from|date_format} to
{$calc_to|date_format}.</h2>
<br />

<div style="height:600px;overflow:auto;">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr style="background: #ccc;">
			<th scope="row" style="padding: 10px;" width="50">&nbsp;</th>
			<td style="padding: 10px;"><b>Rank</b></td>
			<td style="padding: 10px;"><b>Event Name</b></td>
			<td style="padding: 10px;"><b>Votes</b></td>
			<td style="padding: 10px;"><b>Score</b></td>
			<td style="padding: 10px;"><b>Previous Rank</b></td>
		</tr>
		{foreach from=$results item=_event name=events_rank key=_endix}
		<tr style="background: #{cycle values='none,dedede'};"
			onmouseover="tmp=this.style.background;this.style.background='#fff';"
			onmouseout="this.style.background=tmp;">
			<td valign="middle" style="vertical-align: middle; padding: 10px;">
			{if $_event->picture} <img src="{$_event->picture|picture}" alt=""
				width="45" height="45" vspace="center" /> {/if}</td>
			<td valign="middle"
				style="vertical-align: middle; text-align: center; padding: 10px;">{$smarty.foreach.events_rank.index+1}</td>
			<td valign="middle" style="vertical-align: middle;"><a
				href="{$REAL_ROOT}event/{$_event->name|seourl}/"> {$_event->name}</a>
			</td>
			<td valign="middle"
				style="vertical-align: middle; text-align: center;">{$_event->score->votes|default:'0'}</td>
			<td valign="middle"
				style="vertical-align: middle; text-align: center;">{$_event->score->score|number_format:2}</td>
			<td valign="middle" style="vertical-align: middle;text-align: center;">#{$_event->score->previous_rank}</td>
		</tr>
	
		{/foreach}
	</table>
</div>
{/if}
